#!/usr/bin/ruby
# Foung Vang

puts "Enter the first number"
first_number = gets.chomp

puts "Enter the second number"
second_number = gets.chomp

# random choose a # between 1 and 4
operation = rand(1..4)

operation = 1

# if version
puts "if version...\n"
if (operation == 1)
	answer = first_number.to_i + second_number.to_i
	puts "The answer is %d" % answer + "\n\tOperation used is Addition"
elsif (operation == 2)
	answer = first_number - second_number
	puts "The answer is %d" % answer + "\n\tOperation used is Substraction"
elsif (operation == 3)
	answer = first_number * second_number
	puts "The answer is %d" % answer + "\n\tOperation used is Multiplication"
else
	answer = first_number / second_number
	puts "The answer is %d" % answer + "\n\tOperation used is Division"
end		


# case version
puts "\n\ncase version...\n"
case operation
when 1
	puts "The answer is %d" % [ answer = first_number.to_i + second_number.to_i]
	puts "\tOperation used is Addition"
when 1
	puts "The answer is %d" % [ answer = first_number.to_i - second_number.to_i]
	puts "\tOperation used is Substraction"
when 3
	puts "The answer is %d" % [ answer = first_number.to_i * second_number.to_i]
	puts "\tOperation used is Multiplication"
else
	puts "The answer is %d" % [ answer = first_number.to_i / second_number.to_i]
	puts "\tOperation used is Division"
end
